home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 3 / Info_Mac_1994-01.iso / Development / Information / Mac Programming Secrets 1.0.1 / Chapter 06 / Standard Stuff.h < prev   
Text File  |  1992-05-19  |  2KB  |  90 lines

  1. /*******************************************************************************
  2.  
  3.     Here are declarations for all of the C routines. These are used for
  4.     compile time checking of our parameters.
  5.  
  6. *******************************************************************************/
  7.  
  8. void    InitToolbox( void );
  9. void    MainEventLoop( void );
  10.  
  11. /* Event handling routines */
  12.  
  13. void    HandleEvent( EventRecord *event );
  14.  
  15. void    HandleActivate( EventRecord *event );
  16. void    HandleDiskInsert( EventRecord *event );
  17. void    HandleKeyPress( EventRecord *event );
  18. void    HandleMouseDown( EventRecord *event );
  19. void    HandleOSEvent( EventRecord *event );
  20. void    HandleUpdate( EventRecord *event );
  21.  
  22. void    AdjustMenus( void );
  23. void    HandleMenuCommand( long menuResult );
  24.  
  25.  
  26. /* Utility routines */
  27.  
  28. void    CloseAnyWindow( WindowPtr window );
  29. void    DeathAlert( short errorNumber );
  30. Boolean    IsAppWindow( WindowPtr window );
  31. Boolean    IsDAWindow( WindowPtr window );
  32. Boolean    IsDialogWindow( WindowPtr window );
  33. void    InvalidateScrollbars(WindowPtr theWindow);
  34. Boolean    TrapExists(short theTrap);
  35. TrapType    GetTrapType(short theTrap);
  36. short    NumToolboxTraps(void);
  37.  
  38.  
  39. /* Global variables */
  40.  
  41. extern    SysEnvRec    gMac;
  42. extern    Boolean        gQuit;
  43. extern    Boolean        gInBackground;
  44.  
  45. #define NIL            0L
  46. #define MAXLONG        0x7FFFFFFF
  47.  
  48. /* ========================================================================= */
  49. /* ==================== R E S O U R C E   N U M B E R S ==================== */
  50. /* ========================================================================= */
  51.  
  52. #define    rAboutAlert                128            /* about alert */
  53. #define    rErrorAlert                129            /* error user alert */
  54.  
  55. #define rErrorStrings            128
  56. #define    errWimpyROMs            1
  57. #define    errWimpySystem            2
  58. #define    errWeirdSystem            3
  59. #define    errNoMenuBar            4
  60.  
  61. /* The following constants are used to identify menus and their items. The menu IDs
  62.    have an "m" prefix and the item numbers within each menu have an "i" prefix. */
  63.  
  64. #define    rMenuBar                128            /* application's menu bar */
  65.  
  66. #define    mApple                    128            /* Apple menu */
  67. #define    iAbout                    1
  68.  
  69. #define    mFile                    129            /* File menu */
  70. #define    iNew                    1
  71. #define    iOpen                    2
  72. #define    iLine11                    3
  73. #define    iClose                    4
  74. #define    iSave                    5
  75. #define    iSaveAs                    6
  76. #define    iRevert                    7
  77. #define    iLine12                    8
  78. #define    iPageSetup                9
  79. #define    iPrint                    10
  80. #define    iLine13                    11
  81. #define    iQuit                    12
  82.  
  83. #define    mEdit                    130            /* Edit menu */
  84. #define    iUndo                    1
  85. #define iLine21                    2
  86. #define    iCut                    3
  87. #define    iCopy                    4
  88. #define    iPaste                    5
  89. #define    iClear                    6
  90.